package cn.sfrog.common.exception;

/**
 * 自定义异常
 */
public class ApiException extends RuntimeException {

    private Integer status;

    private final String msg;

    private String code;

    public ApiException(String message) {
        this.msg = message;
        this.status = 1;
    }

    public ApiException(String message, Integer status) {
        this.msg = message;
        this.status = status;
    }

    public ApiException(String message, Throwable e) {
        super(message, e);
        this.msg = message;
    }

    @Override
    public String getMessage() {
        return msg;
    }

    public Integer getStatus() {
        return status;
    }
}
